#include "Utils.h"

std::string formatInt(int val, unsigned int len) {
   std::string tempStr = "";
   char buf[100];
   sprintf(buf,"%d",val);
   tempStr =  buf;
   while(tempStr.length() < len) {
      tempStr = "0" + tempStr;
   }
   return tempStr;
};


std::string formatIntHex(int val, unsigned int len) {
   std::string tempStr = "";
   char buf[100];
   sprintf(buf,"%x",val);
   tempStr =  buf;
   while(tempStr.length() < len) {
      tempStr = "0" + tempStr;
   }
   return tempStr;
};


std::string formatUInt(unsigned int val, unsigned int len) {
   std::string tempStr = "";
   char buf[100];
   sprintf(buf,"%u",val);
   tempStr =  buf;
   while(tempStr.length() < len) {
      tempStr = "0" + tempStr;
   }
   return tempStr;
};


std::string formatFloat(double val, int prevdec, int precdec, unsigned int len) {
   std::string tempStr = "";
   char buf[100];
   std::string formatStr = '%'+formatInt(prevdec,1)+'.'+formatInt(precdec,1)+'f';
   sprintf(buf,formatStr.c_str(),val);
   tempStr =  buf;
   while(tempStr.length() < len) {
      tempStr = "0" + tempStr;
   }

   return tempStr;
};

unsigned long int get_elapsed_time() {
    return 0;
}
